# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=py3-syrupy
_pyname=${pkgname/py3-/}
pkgver=4.6.1
pkgrel=1
pkgdesc="The sweeter pytest snapshot plugin"
url="https://tophat.github.io/syrupy"
arch="noarch"
license="Apache-2.0"
depends="python3 py3-pytest py3-colored"
makedepends="py3-poetry-core py3-gpep517"
checkdepends="py3-invoke py3-pytest-benchmark"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tophat/syrupy/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest --snapshot-update
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/$_pyname-$pkgver-py3-none-any.whl
}

sha512sums="
579787b788567d7e22e322cbccf1105666ad6d72d2eb0c0dad90a78714626f925d31d4e6187b9761c82576d47d34e56fda4b6bf39df3e83b2b43a37d1bbc7f0d  py3-syrupy-4.6.1.tar.gz
"
